#ifndef IPCCLIENT_H
#define IPCCLIENT_H

// Qt includes
#include <QtCore/QObject>
#include <QtNetwork/QTcpSocket>
#include <QtCore/QMutex>

class IpcClient : public QObject
{
	Q_OBJECT
public:
	IpcClient(QObject *parent = 0);

	void sendCommand(const QString &command);

	void sendCommand(const QString &command, int value);
	void sendCommand(const QString &command, double value);
	void sendCommand(const QString &command, const int Value[9]);

public slots:
	void open();
	void close();

signals:
	void error(const QString &errorMessage);
	void serverAcknowledged();

private slots:
	void socketReadyRead();
	void socketError(QAbstractSocket::SocketError socketError);

private:
	QTcpSocket *mSocket;
	mutable QMutex mutex;
};

#endif
